import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    color: "red",
  },
  getters: {},
  mutations: {
    changeColor(state) {
      let r = Math.floor(Math.random() * 256);
      let g = Math.floor(Math.random() * 256);
      let b = Math.floor(Math.random() * 256);
      state.color = `rgb(${r},${g},${b})`;
    },
  },
  actions: {},
  modules: {},
});
